/*
RAII - Resource Acquisition Is Initialization
资源获取就是初始化包装类
*/

#pragma once

template<typename T>
class RAIIWrapper
{
public:
    RAIIWrapper(T* p):m_ptr(p) {};
    virtual ~RAIIWrapper()
    {
        if(m_ptr != nullptr )
        {
            delete m_ptr;
            m_ptr = nullptr;
        }
    }

private:
    T* m_ptr;

};

